import request  from '@/utils/request';

import { BASE_URL, OPS_URL } from '@/config/query';

export async function queryPage(params = { pageSize: 10, pageNum: 0 }) {
  return request(`${BASE_URL}/fire_equipment/page`, params)
}

export async function queryInfoById(id) {
  return request(`${BASE_URL}/fire_equipment/detail/${id}`)
}

export async function create(params) {
  return request(`${BASE_URL}/fire_equipment/create`, params)
}

export async function update(params) {
  return request(`${BASE_URL}/fire_equipment/modify`, params)
}

export async function remove(id) {
  return request(`${BASE_URL}/fire_equipment/remove/${id}`)
}

export async function queryLocation({ tail, ...res }) {
  return request(`${BASE_URL}/${tail}/list`, res)
}

export async function queryType({ tail, ...res }) {
  return request(`${OPS_URL}/dict/permission_none/${tail}`, res)
}

export async function queryTemple(params) {
  return request(`${BASE_URL}/help/page`, { ...params, pageSize: 100, pageNum: 1 })
}

export async function importFile({ url }) {
  return request(`${BASE_URL}/fire_equipment/import`, { url })
}